import request from '@/utils/request'

export default{
  //查询所有
  list() {
    return request({
      url: '/admin/edu/teacher/list',
      method: 'get'
    })
  },
  //分页条件查询
  pageList(page, limit, searchObj) {
    return request({
      url: `/admin/edu/teacher/list/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },
  //删除
  deleteOne(id){
    return request({
      url: `/admin/edu/teacher/remvoceOne/${id}`,
      method: 'delete',
    })
  },
  //新增
  save(teacher){
    return request({
      url: `/admin/edu/teacher/save`,
      method: 'post',
      data: teacher
    })
  },
  //根据ID查询讲师数据
  getByIdOne(id){
    return request({
      url:  `/admin/edu/teacher/get/${id}`,
      method: 'get'
    })
  },
  update(teacher){
    return request({
      url: '/admin/edu/teacher/update',
      method: 'put',
      data: teacher
    })
  },
  deleteBatch(idList){
    return request({
      url: '/admin/edu/teacher/deleteBatch',
      method: 'delete',
      data: idList
    })
  },
  selectNameListByKey(key){
    return request({
      url: `/admin/edu/teacher/list/name/${key}`,
      method: 'get'
    })
  }
}
